/*
* ECARX Technology Limited is the owner of the copyright and the trade secret of this software.
* Without permission, no one has the right to obtain, disclose or use this software in any way.
*/

/*
 * Copyright (C) 2008 The Android Open Source Project
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *      http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */

package com.ecarx.notificationx;

import android.app.Notification;
import android.os.Parcel;
import android.os.Parcelable;

public class StatusBarNotification implements Parcelable {

    private String pkg;
    private int id;
    private Notification notification;
    private long postTime;

    public StatusBarNotification() {

    }

    public StatusBarNotification(Parcel in) {
        pkg = in.readString();
        id = in.readInt();
        notification = in.readParcelable(StatusBarNotification.class.getClassLoader());
        postTime = in.readLong();
    }

    public StatusBarNotification(String pkg, int id, Notification notification, long postTime) {
        this.pkg = pkg;
        this.id = id;
        this.notification = notification;
        this.postTime = postTime;
    }

    public String getPkg() {
        return pkg;
    }

    public int getId() {
        return id;
    }

    public Notification getNotification() {
        return notification;
    }

    public long getPostTime() {
        return postTime;
    }

    @Override
    public void writeToParcel(Parcel dest, int flags) {
        dest.writeString(pkg);
        dest.writeInt(id);
        dest.writeParcelable(notification, flags);
        dest.writeLong(postTime);
    }

    @Override
    public String toString() {
        return "StatusBarNotification{" +
                "pkg='" + pkg + '\'' +
                ", id=" + id +
                ", notification=" + notification +
                ", postTime=" + postTime +
                '}';
    }

    @Override
    public int describeContents() {
        return 0;
    }

    public static final Creator<StatusBarNotification> CREATOR = new Creator<StatusBarNotification>() {
        @Override
        public StatusBarNotification createFromParcel(Parcel in) {
            return new StatusBarNotification(in);
        }

        @Override
        public StatusBarNotification[] newArray(int size) {
            return new StatusBarNotification[size];
        }
    };

}
